package com.tuanzi.loan.web.lazy.family;

import com.tuanzi.loan.business.service.family.UserInfoService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.family.UserInfoSearchRequest;
import com.tuanzi.loan.vo.response.family.UserInfoSearchResponse;
import org.springframework.data.domain.Page;

/**
 * @author Ray 2017/09/21
 */
public class UserInfoLazyDataModel extends
        BaseLazyDataModel<UserInfoSearchRequest, UserInfoSearchResponse> {

    private static final long serialVersionUID = 9143007553234885156L;

    private UserInfoService userinfoservice = SpringContextHolder.getBean(UserInfoService.class);

    public UserInfoLazyDataModel(UserInfoSearchRequest searchRequest) {
        super(searchRequest);
    }

    @Override
    protected Page<UserInfoSearchResponse> doLoad(PageSearcher<UserInfoSearchRequest> pageSearcher) {
        return userinfoservice.list(pageSearcher);
    }
}
